/*
 * FileExistOptionDialog.java
 *
 * Created on __DATE__, __TIME__
 */

package dialog;

/**
 *
 * @author  __USER__
 */
public class FileExistOptionDialog extends javax.swing.JDialog {

	/** Creates new form FileExistOptionDialog */
	public FileExistOptionDialog(java.awt.Frame parent, boolean modal) {
		super(parent, modal);
		initComponents();
	}

	public static int fileOption = 0;

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		btnFileAppend = new javax.swing.JButton();
		btnFileOveride = new javax.swing.JButton();
		btnFileDelete = new javax.swing.JButton();
		jLabel1 = new javax.swing.JLabel();

		setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
		setModal(true);
		setName("");

		btnFileAppend.setText("\u8ffd\u52a0");
		btnFileAppend.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnFileAppendActionPerformed(evt);
			}
		});

		btnFileOveride.setText("\u8986\u76d6");
		btnFileOveride.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnFileOverideActionPerformed(evt);
			}
		});

		btnFileDelete.setText("\u5220\u9664");
		btnFileDelete.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnFileDeleteActionPerformed(evt);
			}
		});

		jLabel1.setText("\u5f53\u524d\u4fdd\u5b58\u8def\u5f84\u5df2\u7ecf\u5b58\u5728,\u8bf7\u9009\u62e9\u5982\u4f55\u5904\u7406\u6587\u4ef6");

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addComponent(btnFileAppend,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										119,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED,
										30, Short.MAX_VALUE)
								.addComponent(btnFileOveride,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										119,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addGap(18, 18, 18)
								.addComponent(btnFileDelete,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										119,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addGap(18, 18, 18))
				.addGroup(
						layout.createSequentialGroup()
								.addGap(81, 81, 81)
								.addComponent(jLabel1,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										243,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addContainerGap(109, Short.MAX_VALUE)));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						javax.swing.GroupLayout.Alignment.TRAILING,
						layout.createSequentialGroup()
								.addGap(29, 29, 29)
								.addComponent(jLabel1)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED,
										33, Short.MAX_VALUE)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														btnFileAppend,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														57,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(
														btnFileDelete,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														57,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(
														btnFileOveride,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														57,
														javax.swing.GroupLayout.PREFERRED_SIZE))
								.addGap(32, 32, 32)));

		pack();
	}// </editor-fold>
	//GEN-END:initComponents

	private void btnFileDeleteActionPerformed(java.awt.event.ActionEvent evt) {
		fileOption = 3;
		this.dispose();
	}

	private void btnFileOverideActionPerformed(java.awt.event.ActionEvent evt) {
		fileOption = 2;
		this.dispose();
	}

	private void btnFileAppendActionPerformed(java.awt.event.ActionEvent evt) {
		fileOption = 1;
		this.dispose();
	}

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				FileExistOptionDialog dialog = new FileExistOptionDialog(
						new javax.swing.JFrame(), true);
				dialog.addWindowListener(new java.awt.event.WindowAdapter() {
					public void windowClosing(java.awt.event.WindowEvent e) {
						System.exit(0);
					}
				});
				dialog.setVisible(true);
			}
		});
	}

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JButton btnFileAppend;
	private javax.swing.JButton btnFileDelete;
	private javax.swing.JButton btnFileOveride;
	private javax.swing.JLabel jLabel1;
	// End of variables declaration//GEN-END:variables

}